package com.grape.dp.proxy.myself;

import com.grape.dp.proxy.myself.handler.$Proxy0;
import com.grape.dp.proxy.myself.handler.JavaClassLoader;
import com.grape.dp.proxy.myself.handler.MyJdkInvocationHandler;
import com.grape.dp.proxy.myself.service.OrderService;
import com.grape.dp.proxy.myself.service.impl.OrderServiceImpl;
/**
 * 描述:Test001
 * @author: myx
 * @date: 2019-07-27
 * Copyright © 2019-grape. All rights reserved.
 */
public class Test001 {
    public static void main(String[] args) throws Throwable {
//        OrderService  orderService = new $Proxy0(new MyJdkInvocationHandler(new OrderServiceImpl()));
//        orderService.order();
        OrderService orderService = (OrderService) MyProxy.newProxyInstance(new JavaClassLoader(), OrderService.class, new MyJdkInvocationHandler(new OrderServiceImpl()));
        orderService.order();
    }
}